package com.itheima;

import com.itheima.dao.BookDao;
import com.itheima.dao.UserDao;
import com.itheima.service.UserService;
import com.itheima.service.impl.UserServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import javax.sql.DataSource;

public class App {

    public static void main(String[] args) {
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");

        UserService userService = (UserService) ctx.getBean("userServiceImpl");
        userService.save();

        /*DataSource ds = (DataSource)ctx.getBean("ds");
        System.out.println(ds.toString());*/
        /*UserDao userDao = (UserDao) ctx.getBean("userDaoImpl");
        userDao.save();

        BookDao bookDao = (BookDao) ctx.getBean("bookDaoImpl");
        userDao.save();*/


    }

}
